package com.youfang.sixthmedia;

import com.youfang.sixthmedia.common.YoufangContext;
import com.youfang.sixthmedia.version.VersionManager;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * 闪屏
 * 
 * @author teddy
 * 
 */
public class SplashActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.splash_activity);

		VersionManager.getInstance().startTask();

		new Thread(new Runnable() {

			@Override
			public void run() {
				try {
					Thread.sleep(2000);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}

				gotoMainActivity();

			}

		}).start();

	}

	public void gotoMainActivity() {
		// show manual for the first time...
		Intent intent = new Intent();
		intent.setClass(this,
				YoufangContext.isManualShown() ? MainActivity.class
						: ManualActivity.class);

		this.startActivity(intent);
		this.finish();

	}
}
